import request from '@/utils/request'

export const register = data => {
  return request({
    method: 'POST',
    url: '/user/register',
    data
  })
}

export const login = data => {
  return request({
    method: 'POST',
    url: '/user/login',
    data
  })
}

export const getCurrentUser = () => {
  return request({
    method: 'GET',
    url: '/user'
  })
}

export const updateUser = data => {
  return request({
    method: 'PUT',
    url: '/user',
    data
  })
}